// 使用js 来操作其他的文件,把他们集合到 .html 里边思想,发展出来了webpack
// webpack 打包工具 压缩js,压缩css ,压缩html
// 将外部的css,外部的js,图片 都放到html 里边
const fs = require('fs');
fs.readFile("./axios/chp05-01.txt","utf8",(err,css) => {
  let ss=`<style>${css}</style>`
  console.log(ss);
  fs.readFile("./chp05-01.html","utf8",(err,html) => {
    console.log(html);
    let h2 = `<!DOCTYPE html>
    <html lang="zh-CN">
    <head>
      <meta charset="UTF-8">
      <meta name="author" content="wangbo">
      <meta http-equiv="X-UA-Compatible" content="IE=edge">
      <meta name="viewport" content="width=device-width, initial-scale=1.0">
      <title>Document</title>
     ${ss}
    </head>
    <body>
      <div>我是div</div>
    </body>
    </html>`
    fs.writeFile("./chp05-01.html",h2,"utf8",(err) => {
      
    })
  })
})

// install webpack -g 多个项目都需要使用某个第三方的包